The present invention relates generally to computer systems and more particularly to the creation of macros for definition of customized analytic functionality and geometric functionality using features.
Computer-aided design (CAD) refers to the use of computers to assist in the designing of a product. A designer uses a CAD system to identify critical characteristics of a product. These critical characteristics may include the geometric configuration of the product as well as other properties and attributes of the product.
Most CAD systems create models of products that capture the geometry and other attributes of products. There are a number of different types of models that are used by conventional CAD systems. Some conventional CAD systems create xe2x80x9cfeature modelsxe2x80x9d (also known as xe2x80x9cfeature-based modelsxe2x80x9d), which represent a product as a combination of xe2x80x9cfeatures.xe2x80x9d A xe2x80x9cfeaturexe2x80x9d is a set of data and procedures for generating a shape or characteristic of a product that can be associated with certain attributes and knowledge about the product. Features are the basic building blocks for product modeling and for geometric reasoning about the product. Features allow geometric components of a product to be characterized and associated with a set of attributes.
Some conventional CAD systems generate xe2x80x9cparametric models.xe2x80x9d Parametric models represent models as sets of procedures having input parameters (such as dimension values) and output geometry. A parametric model stores a procedure for constructing the computer model of a product. In parametric models, the procedure for constructing the product may be viewed as a sequence of assignments to model variables as a function of input parameters for parametric equations. To create parametric variations, the construction procedure is reevaluated after changing the values of the input parameters (such as dimension values). This definition of xe2x80x9cparametric modelsxe2x80x9d includes xe2x80x9cvariational modelsxe2x80x9d or xe2x80x9cvariable-driven modelsxe2x80x9d generated by some conventional CAD systems.
In conventional CAD systems that employ feature based modeling, a library of standard features is maintained. This library allows designers to easily form product models as a combination of features extracted from the feature library.
Unfortunately, feature libraries are limited and the ability of conventional CAD systems to facilitate custom definition of analytic functionality and geometric functionality are also limited. For example, if a user of a conventional CAD system wishes to apply a new type of engineering analysis (that is not predefined by the CAD program), the user must employ other means to perform the analysis such as encoding a sequence of computer instructions for performing the analysis (i.e. write a new program).
The present invention addresses the above-described limitations of conventional CAD systems by providing a mechanism for readily creating macros for performing user-defined analytic functionality and/or user-defined geometric functionality. The macros are defined as sequences of features that are part of a feature-based modeling environment. The sequence of features that define a macro describe a procedure for performing user-defined analysis and/or creating user-defined geometry. A macro can be used as the procedure that defines a non-standard feature that can be added to a library of features accessible by users. The user is not required to generate any macro language instructions, and the user is not required to understand the proper syntax for creation of the macro. Once defined, the macros may be applied all over a model, if appropriate. Thus, a macro may be defined for a portion of a model and then applied to other portions of the model. A macro may be defined for a particular point and then applied to all points belonging to a more complex geometric object, such as collections of points, single or multiple curves, or single or multiple surfaces. Those skilled in the art will appreciate that a macro may be defined for a particular type of geometric entity and then applied to all entries of that type belonging to a more complex geometric object. Furthermore, the macros may be applied to geometric objects belonging to models other than the initial model for which the macro was defined. Applying a macro does not add the sequence of features that define it to the feature-based model to which the macro is applied; rather the result is at least one user-defined analysis and/or userdefined geometric entity. In one embodiment, the present invention provides an easy to use user interface for a user to identify the features to be included in the macro and to create the macro. Once the macro is created, the macro may be called by name.
In accordance with one aspect of the present invention, a method is performed on a computer system that has an initial model representing a geometric object. A group of features are provided relative to the initial model. These features may, for example, define an analysis that is to be applied to the initial model or may define additional custom geometric functionality for the initial model. The user wishes to incorporate these features into a macro. The macro is generated from the group of features, and the macro is applied to at least a portion of a selected model. The method may be performed by a CAD system, and the model may be a parametric model. The selected model may be the initial model or a different one.
In accordance with another aspect of the present invention, features are recorded for an initial model of a geometric object in a CAD system. The user of the CAD system makes a request to create a macro, and the macro is created to include at least some of the features that have been recorded. The resulting macro is applied to at least a portion of a selected model without adding features from the macro to the selected model.
In accordance with an additional aspect of the present invention, an analysis is defined for a portion of a feature-based model of a geometric object. A macro is generated for performing the analysis without the user generating macro language instructions. The macro contains features for a feature-based model of the geometric object. The macro is applied to a second portion of the feature-based model or to a different model, to perform analysis on the second portion or to perform analysis of the different model without adding features from the macro to the selected model. The portion for which analysis is defined can be a single point, whereas the analysis may be applied to all points belonging to a more complex geometric object, such as a collection of points, one or more curves, or one or more surfaces.
In accordance with a further aspect of the present invention, a computer-implemented method is practiced in the computer system. Per this method, customer geometry is defined for an initial feature-based model of a geometric object. The macro is generated for defining the customer geometry with other user generated macro language instructions. The macro contains features for the initial feature-based model of the geometric object. The macro is then applied to a selected feature-based model of the geometric object to define custom geometry without adding features from the macro to the selected model. The custom geometric entity can be defined for a single point and then applied to all points belonging to a more complex geometric object, such as collections of points, one or more curves or one or more surfaces. Applying the macro to these more complex geometric objects generates geometric entities of higher dimension than generated for a single point. For example, if when applied to a point, a macro generates a custom point, then the macro may generate a custom curve when applied to a representative covering of points on a curve and a custom surface when applied to a representative covering of points on a surface.
In accordance with a further aspect of the present invention, a CAD system includes a model for a geometric object and a macro generator for creating a macro containing features for the model. The macro is created in response to a user request and without the user specifying macro instructions. The CAD system may additionally include a user interface element for enabling a user to request the creation of the macro.
In accordance with another aspect of the present invention, a computer system includes a model representing a geometric object. A group of features that the user wishes to incorporate into a macro are provided for the model. The user generates the macro from the group of features and the macro is applied to at least a portion of the selected model to create a user-defined feature.